package com.meiyou.mapper;

import com.meiyou.annotation.AutoFill;
import com.meiyou.dto.StarDto;
import com.meiyou.entity.Star;
import com.meiyou.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;

/**
 * @BelongsProject: meiyou
 * @BelongsPackage: com.meiyou.mapper
 * @Author: 尹晓安
 * @Date: 2023/11/25 18:10
 * @Description: todo
 */
@Mapper
public interface StarMapper {

    /**
     * 添加数据，点赞
     * @param star
     */
    @AutoFill(value = OperationType.INSERT)
    void add(Star star);

    /**
     * 查询数据
     * @param star
     */
    Integer select(Star star);

    /**
     * 取消点赞
     * @param star
     */
    void delete(Star star);

    /**
     * 根据文章id删除点赞
     *
     * @param articleId 文章id
     */
    void removeByArticleId(Long articleId);
}
